﻿using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;

namespace OAuth2Authorizer.Serialization
{
    internal class SerializerFactory
    {
        public static ISerializer<T> CreateSerializer<T>(string contentType)
        {
            ISerializer<T> serializer = default(ISerializer<T>);
            if (contentType.Contains("application/json"))
                serializer = new JsonSerializer<T>();
            if (contentType.Contains("text/plain"))
                serializer = new FormEncodedSerializer<T>();
            return serializer;
        }
    }
}
